package model;

import java.io.File;
import java.io.IOException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.xml.sax.SAXException;

public class XmlUtil {
    public static Document read(File file) throws SAXException, IOException {
	try {
	    DocumentBuilderFactory builderFactory = DocumentBuilderFactory
		    .newInstance();
	    DocumentBuilder builder = builderFactory.newDocumentBuilder();
	    return builder.parse(file);

	} catch (ParserConfigurationException e) {
	    // This exception is never thrown, treat as fatal if it is
	    throw new RuntimeException(e);
	}
    }
}